<!DOCTYPE html>
<html style="width:100%;height:100%;">
<head>
	<meta charset="UTF-8">
	<title>Reports using TreeGrid - jQuery EasyUI Demo</title>
	<link rel="stylesheet" type="text/css" href="/static/jquery-easyui-1.5.1/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="/static/jquery-easyui-1.5.1/themes/icon.css">
	<script type="text/javascript" src="/static/js/jquery-1.10.1.min.js"></script>
	<script type="text/javascript" src="/static/jquery-easyui-1.5.1/jquery.min.js"></script>
	<script type="text/javascript" src="/static/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/static/js/HhUtil.js?t=20170109"></script>

	<script type="text/javascript">

    var dataGrid;

    $(function () {
        //首次进入拉取
        dataGrid = $('#dataGrid').datagrid({
            url: '/tjdetail',
            method:'get',
			width: '100%',
            fit: true,
            striped: true,
            singleSelect: true,
            columns: [[{
                width: '40%',
                title: '描述',
                field: 'sub_type_desc',
            }, {
                width: '30%',
                title: '次数',
                field: 'cnt1',
                sortable: false
            }, {
                width: '30%',
                title: '用户数',
                field: 'cnt2',
                sortable: false,
                hidden: true
            }]],
			onLoadSuccess: function (data) {
                $('.user-easyui-linkbutton-del').linkbutton({text: '删除', plain: true, iconCls: 'icon-del'});
            },
            toolbar: '#toolbar'
        });
        });

        function searchFun() {
            dataGrid.datagrid('load', $.serializeObject($('#searchForm')));
        }
        function cleanFun() {
            $('#searchForm input').val('');
            dataGrid.datagrid('load', {});
        }

    </script>
</head>
<body style="width:100%;height:100%;margin: 0px">
<div class="easyui-layout" style="width:100%;height:100%;position: absolute;left: 0px;top:0px;margin:0px">
	<div data-options="region:'west',split:true" title="" style="width:15%;height:100%;margin: 0px;">
        <ul class="easyui-tree">
            <li>
                <span>注册</span>
                <ul>
                    <li>
                        <span><a href="javascript:aaa('zhuce', $('#p_type').combobox('getValue'), '注册量统计')" style="text-decoration:none;color:black">注册量统计</a></span>
                    </li>
                </ul>
			</li>

            <li>
                <span>客户端</span>
                <ul>
                    <li>
                        <span>浏览量</span>
                        <ul>
                            <li><span><a href="javascript:aaa('viewd', $('#p_type').combobox('getValue'), '按日期统计')" style="text-decoration:none;color:black">按日期统计</a></span></li>
                            <li><span><a href="javascript:aaa('viewt', $('#p_type').combobox('getValue'), '按时间点统计')" style="text-decoration:none;color:black">按时间点统计</a></span></li>
                        </ul>
                    </li>
                    <li>
                        <span><a href="javascript:aaa('collect', $('#p_type').combobox('getValue'), '收藏量')" style="text-decoration:none;color:black">收藏量</a></span>
                    </li>
                </ul>
			</li>

            <li>
                <span>短讯</span>
                <ul>
                    <li>
                        <span><a href="javascript:aaa('smssign', $('#p_type').combobox('getValue'), '短讯签到统计')" style="text-decoration:none;color:black">短讯签到统计</a></span>
                    </li>
                    <li>
                        <span><a href="javascript:aaa('smspull', $('#p_type').combobox('getValue'), '短讯拉取统计')" style="text-decoration:none;color:black">短讯拉取统计</a></span>
                    </li>

                </ul>
			</li>
		</ul>
	</div>

	<div data-options="region:'center',split:true" title="" style="width:50%;height:100%;margin: 0px;">
		<div data-options="region:'center',border:true,title:''" style="height: 100%;width:100%">
			<table style="display: none" id="dataGrid" data-options="fit:true,border:false">
			</table>
		</div>
	</div>
</div>

<div id="toolbar" style="display: none;">
    <form id="searchForm">
        <input type="hidden" id="form_type" name="type" value="zhuce">
        <table>
            <tr>
                <th>客户端:</th>
                <td><select id="p_type" data-options="required:true" class="easyui-combobox" name="pro_type">
                    <option value="0">手机客户端(1.4)</option>
                    <option value="3">wap站</option>
                    <option value="5">HD客户端</option>
                    <option value="7">化工</option>
                    <option value="8">农业</option>
                    <option value="9">金属</option>
                </select></td>
                <td>

                    <a href="javascript:void(0);" class="easyui-linkbutton"
                       data-options="iconCls:'icon-search',plain:true" onclick="searchFun();">查询</a><a
                        href="javascript:void(0);" class="easyui-linkbutton"
                        data-options="iconCls:'icon-cancel',plain:true" onclick="cleanFun();">清空</a>
                </td>
                <td><span id="menu_title" style="margin-left: 10px;height: 30px">注册量统计</span></td>
            </tr>
        </table>
    </form>
</div>

</body>

<script type="text/javascript">
    function aaa(stype, pro_type, menu_title){
//        alert($(".textbox-value[name=pro_type]").val());
        $('#menu_title').html(menu_title);
        $('#form_type').val(stype);
        if (stype=='zhuce'||stype=='collect'||stype=='smssign'){
            dataGrid.datagrid('hideColumn', 'cnt2');
        }else{
            dataGrid.datagrid('showColumn', 'cnt2');
        }
        dataGrid.datagrid('load', {
            type: stype,
            pro_type: pro_type
        })
    }
</script>
</html>